package com.gao.controller;

import com.gao.domain.Users;
import com.gao.service.IUsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author gao
 * @time 2020/05/29 17:25:14
 */
@Controller
@RequestMapping("users")
public class UsersController {
    @Autowired
    private IUsersService service;

    @GetMapping
    public String findAll(Model model) {
        List<Users> usersList = service.find();
        model.addAttribute("usersList", usersList);
        return "home";
    }

}
